local sk__aozhan = fk.CreateSkill {

  name = "sk__aozhan",

  tags = {  },

}



sk__aozhan:addEffect("active", {
  name = "sk__aozhan",
  anim_type = "drawcard",
  card_num = 0,
  target_num = 0,
  prompt = "#sk__aozhan",
  derived_piles = "sk__aozhan",
  interaction = function()
    return UI.ComboBox {choices = {"prey", "recast"}}
  end,
  card_filter = Util.FalseFunc,
  can_use = function(self, player)
    return #player:getPile("sk__aozhan") > 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    if self.interaction.data == "prey" then
      room:moveCardTo(player:getPile("sk__aozhan"), Card.PlayerHand, player, fk.ReasonJustMove, sk__aozhan.name, nil, false, player)
    else
      room:recastCard(player:getPile("sk__aozhan"), player, sk__aozhan.name)
    end
  end,
})

sk__aozhan:addEffect(fk.Damage, {
  name = "#sk__aozhan_trigger",
  mute = true,
  --sk__aozhan,
  can_trigger = function(self, event, target, player, data)
    return target and target == player and player:hasSkill(sk__aozhan.name) and data.card and
      (data.card.trueName == "slash" or data.card.trueName == "duel")
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke("sk__aozhan")
    room:notifySkillInvoked(player, "sk__aozhan", "special")
    player:addToPile("sk__aozhan", room:getNCards(data.damage), false, "sk__aozhan", player.id)
  end
})
sk__aozhan:addEffect(fk.Damaged, {
  name = "#sk__aozhan_trigger",
  mute = true,
  --sk__aozhan,
  can_trigger = function(self, event, target, player, data)
    return target and target == player and player:hasSkill(sk__aozhan.name) and data.card and
      (data.card.trueName == "slash" or data.card.trueName == "duel")
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke("sk__aozhan")
    room:notifySkillInvoked(player, "sk__aozhan", "special")
    player:addToPile("sk__aozhan", room:getNCards(data.damage), false, "sk__aozhan", player.id)
  end
})

return sk__aozhan